import React,{Component} from 'react';
import PropTypes from 'prop-types';
import './content.less'
const prefix = 'content';
class Content extends Component {
    render(){
        let {contentSource} = this.props;
        let contentEle = contentSource.map((value,index)=>{
            return(
                   <div className={prefix+"-container clearfix"} key={index}>
                       <div>
                           <p className={prefix+"-title"}>{value.title}</p>
                           {/*<p className={prefix+"-summary"}>{value.summary}</p>*/}
                       </div>
                       <div className="clearfix">
                           <a href={value.link} className={prefix+"-img"}>
                               <img src={value.img} alt=""/>
                           </a>
                           <div className={prefix+"-introduce"}>
                               <p className={prefix+'-intro-title'}>{value.title}</p>
                               <p className={prefix+'-intro-content'}>{value.content}</p>
                               <a href={value.link} className={prefix+"-more"}>{value.more}</a>
                           </div>
                       </div>
                   </div>
            )
        });
        return(
            <div className={prefix}>
                {contentEle}
            </div>
        )
    }
}
export default Content;
Content.propTypes = {
    contentSource:PropTypes.array.isRequired
}